#ifndef FIND_DUPLICATES
#define FIND_DUPLICATES

#include <QObject>
#include <QWaitCondition>
#include <QMutex>
#include <QThread>
#include <QFileInfo>
#include <QString>
#include <QDateTime>
#include <QSemaphore>
#include "fileslist.hpp"

class FindDuplicates:public QThread{
	Q_OBJECT
			
	public:
		FindDuplicates(FilesList*,QWaitCondition *,QMutex *,QMutex *,QSemaphore *,QWidget *);
		~FindDuplicates();
		void setOption(int);
		void byName();
		void bySuffix();
		void byAll();
		void run();
	private:
		int option;
		FilesList *files;
		QWaitCondition *wc;
		QMutex *mut_ui,*mut_fl;
		QSemaphore *sem;
		bool ff;
		bool terminated;
	public slots:
		void filesFinished();
		void stop();
	signals:
		void duplicate(QList<QFileInfo *> *);
};

#endif

